<%@ page language="java" pageEncoding="utf-8"%>
<%@taglib prefix="s" uri="/struts-tags"%>
${aier_doctype}
<html <s:property value="aier-html-xmlns" escape="false"/>>
<head>
<meta http-equiv="Content-Type" content="${aier_content_type}" />
<meta name="keywords" content="${aier_keyworks}" />
<meta name="description" content="${aier_description}" />
<title>${aier_title}</title>
<link rel="stylesheet" href="${aier_css_url}${aier_jqui_css}ui.css" />
<link rel="Stylesheet" href="${aier_css_url}jq/jq.css" />
<link rel="Stylesheet" href="${aier_css_url}jq/multiselect.css" />
<link rel="stylesheet" href="${aier_css_url}jc/chosen.css" >
<link rel="stylesheet" href="${aier_css_url}social/module/jq-msg.css" />
<link rel="stylesheet" href="${aier_css_url}social/module/reset.css" />
<link rel="stylesheet" href="${aier_css_url}social/school/common.css" />
<link rel="stylesheet" href="${aier_css_url}social/school/smanage.css" />
<link rel="stylesheet" href="${aier_css_url}social/module/xxs.css" />

<script type="text/javascript" src="${aier_js_url}j.js"></script>
<script type="text/javascript" src="${aier_js_url}b.js"></script>
<script type="text/javascript" src="${aier_js_url}${aier_jqui_js}ui.js"></script>
<script type="text/javascript" src="${aier_js_url}97/WdatePicker.js"></script>
<script type="text/javascript" src="${aier_js_url}jp/msg.js"></script>
<script type="text/javascript" src="${aier_js_url}jq/cn.js"></script>
<script type="text/javascript" src="${aier_js_url}jq/jq.js"></script>
<script type="text/javascript" src="${aier_js_url}lib/ja.js"></script>
<script type="text/javascript" src="${aier_js_url}jc/cj.js"></script>
<script type="text/javascript" src="${aier_js_url}lib/block.js"></script>
<script type="text/javascript" src="${aier_js_url}jq/multiselect.js"></script>
<script type="text/javascript">
	var global_suffix = "${aier_suffix}", global_url = "${aier_url}", global_uri = "${aier_uri}", global_urijs = "${aier_urijs}", 
		global_sid = "${sid}",global_tid = "${tid}";
</script>
</head>
<!-- 教师审核页面 -->
<body> 
	<!-- 顶栏 -->
	<s:action name="userhomecomm_homeHead" namespace="/user"
		executeResult="true"></s:action>

	<!-- 正文 -->
	<div id="hfContent" class="ar-content">
		<div class="content-main">
			<!-- 学校名称栏 -->
			<s:action name="scomm_schoolMTitle" namespace="/school" executeResult="true"></s:action>
			<div class="main-content wrap-bg clearfix">
				<!-- 左侧栏 -->
				<s:action name="scomm_schoolMLeft" namespace="/school" executeResult="true"></s:action>
				<!-- 右侧内容 -->
				<div class="ae-right">
					<div class="right-main">
						<div class="right-main-top">
							<div class="binfo-title">
								<span>教师审核</span>
							</div>
							<div class="right-line">
								
							</div>
						</div>
						<div class="right-main-c">
							<div class="info-tab01" id="schoolmessage">
								
							</div>
						</div>
					</div>
					<div id = "page">
						
					</div>
				</div>
			</div>

		</div>
		<!-- footer copyright -->
		<s:action name="userhomecomm_homeFooter" namespace="/user" executeResult="true"></s:action>
		<!-- /footer copyright -->
	</div>
</body>

<script type="text/javascript">
    var page = 1;       // 当前页
    var page_size = 10; // 每页的记录数
    
	$(".chosen").chosen();
	
	$(document).ready(function() {
		load(page);
	});

	function load(nowpage){
	    page = nowpage;
		var funadd2 = function(data){
			if (data.s == 1) {
				if(data.requestTeacherList.length > 0){
					var msg_html = "";		
					for( var i = 0; i < data.requestTeacherList.length; i++ ){
						var tname = data.requestTeacherList[i].tname;
						var headimg = data.requestTeacherList[i].user.headimg;
						var content = data.requestTeacherList[i].content;
						var ctime_str = data.requestTeacherList[i].ctime_str;
						var rtid = data.requestTeacherList[i].rtid;
						msg_html += "<div class='exam clearfix'><dl class='e-user'><dt><img src='${get_picturl_url}small/"+headimg+"' class='face'></dt>"
								+ "<dd><span></span><span><a href='javascript:;'>"+tname+"</a></span></dd></dl>"
								+"<div class='e-info'><p>申请加入学校<span>"+ctime_str+"</span></p><p class='apinfo'>"+content+"</p>"
								+"</div><div class='e-btns'><a href='javascript:;' class='button' onclick='upreq_yes("+rtid+");' ><em>同意</em></a>"
								+"<a href='javascript:;' class='button e-btns-no' onclick='upreq_no("+rtid+");' ><em>拒绝</em></a></div></div>";
					}
					$("#schoolmessage").html(msg_html);
					// 更新分页显示
					page = data.page;
                    toLoadPage(page, page_size, data.page_count, data.count, "page", "load", null, null); 
				}else{
					$("#schoolmessage").html("");
				}
			} else {
			    $("#schoolmessage").html("");
			}
			if (isnull($("#schoolmessage").html())) {
                $("#page").css("display","none");
            } else {
                $("#page").css("display","block");
            }
		};
		exeAjax(ajaxUrl("${aier_url}${aier_urijs}schooltaudit_searchRequestTeacherList${aier_suffix}"), funadd2, {
		"sid":global_sid,
		"tid":global_tid,
		"page":page,
		"page_size":page_size});		
	}
	
	function upreq_yes(rtid){
		if(confirm("确定同意该申请码?")){
			var fun = function(data) {
				load(page);
			};
			exeAjax(ajaxUrl("${aier_url}${aier_urijs}schooltaudit_updateRequestTeacherState${aier_suffix}"), fun, 
				{"sid" : global_sid,"rtid" :rtid,"state":1,"tid":global_tid});		
		}
	}
	
	function upreq_no(rtid){
		if(confirm("确定拒绝该申请码?")){
			var fun = function(data) {
				load(page);
			};
			exeAjax(ajaxUrl("${aier_url}${aier_urijs}schooltaudit_updateRequestTeacherState${aier_suffix}"), fun, 
				{"sid" : global_sid,"rtid" :rtid,"state":2,"tid":global_tid});
		}			
	}	



</script>



</html>